<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.activities.LoginActivity">

    <androidx.constraintlayout.widget.Group
        android:id="@+id/bottomCenter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/password" />


    <Button
        android:id="@+id/grayed_log_in_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:enabled="false"
        android:text="@string/log_in"
        app:layout_constraintBottom_toTopOf="@+id/bottomCenter"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        tools:ignore="DuplicateSpeakableTextCheck" />

    <Button
        android:id="@+id/log_in_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/log_in"
        app:layout_constraintBottom_toTopOf="@+id/bottomCenter"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        tools:ignore="DuplicateSpeakableTextCheck" />

    <ImageView
        android:id="@+id/log_in_icon"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:contentDescription="@string/log_in"
        app:layout_constraintBottom_toTopOf="@+id/server"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_round_login_24"
        tools:ignore="ImageContrastCheck" />

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/server"
        style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
        android:layout_width="@dimen/login_field_width"
        android:layout_height="wrap_content"
        android:hint="@string/select_server"
        android:labelFor="@+id/select_server_text_view"
        app:placeholderText="@string/select_server_hint"
        app:layout_constraintBottom_toTopOf="@+id/username"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent">

        <AutoCompleteTextView
            android:id="@+id/select_server_text_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="none"
            tools:ignore="TextContrastCheck" />

    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/username"
        android:layout_width="@dimen/login_field_width"
        android:layout_height="wrap_content"
        android:hint="@string/username"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textEmailAddress"
            tools:ignore="TextContrastCheck" />

    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/password"
        android:layout_width="@dimen/login_field_width"
        android:layout_height="wrap_content"
        android:hint="@string/password"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/username"
        app:passwordToggleEnabled="true">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textPassword"
            tools:ignore="TextContrastCheck" />

    </com.google.android.material.textfield.TextInputLayout>

    <Button
        android:id="@+id/demo_button"
        style="@style/Widget.Material3.Button.TextButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/demo_mode"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/bottomCenter" />

</androidx.constraintlayout.widget.ConstraintLayout>